﻿CREATE PROCEDURE [ServiceEngine].[GetSchemaObjectByID]
@SchemaObjectID UNIQUEIDENTIFIER
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    -- Insert statements for procedure here
  SELECT 
		SO.[SchemaObjectID],
		SO.[SchemaObjectName],
		SO.[SchemaObjectType],
		SO.[SchemaObjectXml],
		N.EntityName,
		SO.DataEntityID
  FROM 
		[SchemaObjects] SO JOIN [Names] N ON N.EntityID = SO.SchemaID 
  WHERE
		SO.[SchemaObjectID] = @SchemaObjectID
END

